<%--
    Document   : forms
    Created on : Mar 8, 2011, 6:42:55 PM
    Author     : developer
--%>

<%@page language="java" contentType="text/html" pageEncoding="UTF-8"
        import="tcc.sglj.model.User"
        %>

<%

    //if (request.getSession().getAttribute("user") == null) {
    //     response.sendRedirect("../index.jsp");
    // }
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>

        <div id="form_cadastro_usuario" title="Novo cadastro">
            <form action="" id="cadastro_usuario">
                <input type="hidden" id="id_usuario" readonly="readonly" />
                <p>
                    <label class="label-formulario">Nome completo *</label>
                    <input type="text" id="nome_usuario" name="nome_usuario" class="required" maxlength="60" style="width: 300px;"/>
                </p>
                <p>
                    <label class="label-formulario">Nº CPF *</label>
                    <input type="text" id="cpf_usuario" name="cpf_usuario" class="required cpf disponivel_cpf" style="width: 150px;" />
                </p>
                <p>
                    <label class="label-formulario">Email *</label>
                    <input type="text" id="email_usuario" name="email_usuario" class="required email disponivel_email" maxlength="60" style="width: 300px;" />
                </p>
                <p>
                    <label class="label-formulario">Telefone </label>
                    <input type="text" id="telefone_usuario"  name="telefone_usuario" maxlength="15"  style="width: 150px;"/>
                </p>
                <p>
                    <label class="label-formulario">Senha *</label>
                    <input type="password" id="npassw" name="npassw" class="required senha" maxlength = '16'  style="width: 150px;"/>
                </p>
                <p>
                    <label class="label-formulario" >Confirmar Senha *</label>
                    <input type="password" id="cpassw" name="cpassw" class="required senha confirmar" maxlength = '16'  style="width: 150px;"/>
                </p>
                <%
                    User user = (User) request.getSession().getAttribute("user");
                    if (user != null && user.isPermission()) {
                        out.println("<p><label><input type='checkbox' id='permissao'> Permitir ao usuário acesso de administrador.</label></p>");
                    } else {
                        out.println("<input type='checkbox' id='permissao' style='display:none' readonly='readonly'>");
                    }
                %>

            </form>
        </div>


        <div id="form_editar_usuario">
            <form action="" id="cadastro_usuario">
                <input type="hidden" id="id_usuario" readonly="readonly" />
                <p>
                    <label class="label-formulario">Nome completo *</label>
                    <input type="text" id="nome_usuario" name="nome_usuario" class="required" maxlength="60" style="width: 300px;"/>
                </p>
                <p>
                    <label class="label-formulario">Nº CPF *</label>
                    <input type="text" id="cpf_usuario" name="cpf_usuario" class="required cpf disponivel_cpf" style="width: 150px;" />
                </p>
                <p>
                    <label class="label-formulario">Email *</label>
                    <input type="text" id="email_usuario" name="email_usuario" class="required email disponivel_email" maxlength="60" style="width: 300px;" />
                </p>
                <p>
                    <label class="label-formulario">Telefone </label>
                    <input type="text" id="telefone_usuario"  name="telefone_usuario" maxlength="15"  style="width: 150px;"/>
                </p>  
                <%
                    if (user != null && user.isPermission()) {
                        out.println("<p><label><input type='checkbox' id='permissao'> Permitir ao usuário acesso de administrador.</label></p>");
                    } else {
                        out.println("<input type='checkbox' id='permissao' style='display:none' readonly='readonly'>");
                    }
                %>
            </form>
        </div>

        <div id="form_cadastro_servico" title="Novo cadastro">
            <form action="" id="cadastro_servico" name="cadastro_servico">
                <input type="hidden" id="id_servico" maxlength="60" />           
                <p>
                    <label class="label-formulario">Serviço *</label>
                    <input type="text" id="nom_servico" name="nom_servico" class="required" style="width: 300px;"/>
                </p>
                <p>
                    <label class="label-formulario">Valor *</label>
                    <input type="text" id="num_preco" name="num_preco" class="required" />
                </p>
                <p>
                    <label class="label-formulario">Descrição *</label>
                    <textarea id="des_servico"  name="des_servico"class="required" style="width: 300px; height: 60px;"></textarea>
                </p>                       
            </form>
        </div>

        <div id="form_tabela_apoio">
            <ul>
                <li><a href="#tab_marca">Marca</a></li>
                <li><a href="#tab_veiculo">Modelo Veículos</a></li>
            </ul>
            <div id="tab_marca">
                <form action="" id="cadastro_marca" name="cadastro_marca">
                    <input type="hidden" id="id_marca"/>           
                    <p>
                        <label class="label-formulario">Nome marca *</label>
                        <input type="text" id="nm_marca" name="nm_marca" class="required" style="width: 300px;"/>
                    </p>
                </form>
            </div>
            <div id="tab_veiculo">
                <form action="" id="cadastro_modelo" name="cadastro_modelo">
                    <input type="hidden" id="id_modelo" />     
                    <p>
                        <label class="label-formulario">Nome marca *</label>
                        <select id="id_marca_fabricante">
                            <option value=""> --selecione-- </option>
                        </select>
                    </p>
                    <p>
                        <label class="label-formulario">Nome marca *</label>
                        <input type="text" id="nm_modelo" name="nm_modelo" class="required" style="width: 300px;"/>
                    </p>
                </form>
            </div>
        </div>